package net.lanelife.casino.caipiao.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import net.lanelife.casino.common.entity.annotation.Checked;
import net.lanelife.casino.common.entity.support.CheckableEntity;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Type;
import org.joda.time.DateTime;

@Entity
@DynamicInsert
@DynamicUpdate
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Table(name = "TB_USER_LAYER")
public class UserLayer extends CheckableEntity<Integer> {

	private static final long serialVersionUID = 3034432338244912290L;

	/**
	 * 层级名称
	 */
	@Checked
	@Column(name = "NAME", length = 10, nullable = false)
	private String name;

	/**
	 * 说明
	 */
	@Column(name = "DESCRIPTION", length = 200, nullable = false)
	private String description = "";
	
	/**
	 * 是否默认
	 */
	@Column(name = "IS_DEFAULT", nullable = false)
	private Boolean isDefault = Boolean.FALSE;
	
	/**
	 * 用户数
	 */
	@Column(name = "LAYER_USERS", nullable = false)
	private Long layerUsers = 0L;
	
	/**
	 * 排序
	 */
	@Column(name = "DEEP", nullable = false)
	private Integer deep;
	
	// ================================== 层级要求 ==================================
	/**
	 * 注册时间（起）
	 */
	@Column(name = "REGISTER_BEGIN_TIME")
	@Type(type = "net.lanelife.casino.common.entity.usertype.PersistentDateTimeAsMillisLong")
	private DateTime registerBeginTime;
	
	/**
	 * 注册时间（止）
	 */
	@Column(name = "REGISTER_END_TIME")
	@Type(type = "net.lanelife.casino.common.entity.usertype.PersistentDateTimeAsMillisLong")
	private DateTime registerEndTime;
	
	/**
	 * 充值次数
	 */
	@Column(name = "RECHARGE_TIMES", nullable = false)
	private Long rechargeTimes;
	
	/**
	 * 充值总额
	 */
	@Column(name = "RECHARGE_TOTAL", nullable = false)
	private Double rechargeTotal;
	
	/**
	 * 最大充值金额
	 */
	@Column(name = "RECHARGE_MAX", nullable = false)
	private Double rechargeMax;
	
	/**
	 * 提款次数
	 */
	@Column(name = "WITHDRAW_TIMES", nullable = false)
	private Long withdrawTimes;
	
	/**
	 * 提款总额
	 */
	@Column(name = "WITHDRAW_TOTAL", nullable = false)
	private Double withdrawTotal;
	
	// ================================== 层级配置 ==================================
	/**
	 * 单笔最小提款金额
	 */
	@Column(name = "ONETIME_WITHDRAW_AMOUNT_MIN", nullable = false)
	private Double oneTimeWithdrawAmountMin;
	
	/**
	 * 单笔最大提款金额
	 */
	@Column(name = "ONETIME_WITHDRAW_AMOUNT_MAX", nullable = false)
	private Double oneTimeWithdrawAmountMax;
	
	/**
	 * 每日最大提款次数
	 */
	@Column(name = "DAILY_WITHDRAW_TIMES_MAX", nullable = false)
	private Long dailyWithdrawTimesMax;
	
	/**
	 * 每日最大提款金额
	 */
	@Column(name = "DAILY_WITHDRAW_AMOUNT_MAX", nullable = false)
	private Double dailyWithdrawAmountMax;
	
	/**
	 * 单笔最小充值金额
	 */
	@Column(name = "ONETIME_RECHARGE_AMOUNT_MIN", nullable = false)
	private Double oneTimeRechargeAmountMin;
	
	/**
	 * 单笔最大充值金额
	 */
	@Column(name = "ONETIME_RECHARGE_AMOUNT_MAX", nullable = false)
	private Double oneTimeRechargeAmountMax;
	
	/**
	 * 每日最大充值次数
	 */
	@Column(name = "DAILY_RECHARGE_TIMES_MAX", nullable = false)
	private Long dailyRechargeTimesMax;
	
	/**
	 * 每日最大充值金额
	 */
	@Column(name = "DAILY_RECHARGE_AMOUNT_MAX", nullable = false)
	private Double dailyRechargeAmountMax;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	
	public Boolean getIsDefault() {
		return isDefault;
	}

	public void setIsDefault(Boolean isDefault) {
		this.isDefault = isDefault;
	}

	public Long getLayerUsers() {
		return layerUsers;
	}

	public void setLayerUsers(Long layerUsers) {
		this.layerUsers = layerUsers;
	}

	public Integer getDeep() {
		return deep;
	}

	public void setDeep(Integer deep) {
		this.deep = deep;
	}

	public DateTime getRegisterBeginTime() {
		return registerBeginTime;
	}

	public void setRegisterBeginTime(DateTime registerBeginTime) {
		this.registerBeginTime = registerBeginTime;
	}

	public DateTime getRegisterEndTime() {
		return registerEndTime;
	}

	public void setRegisterEndTime(DateTime registerEndTime) {
		this.registerEndTime = registerEndTime;
	}

	public Long getRechargeTimes() {
		return rechargeTimes;
	}

	public void setRechargeTimes(Long rechargeTimes) {
		this.rechargeTimes = rechargeTimes;
	}

	public Double getRechargeTotal() {
		return rechargeTotal;
	}

	public void setRechargeTotal(Double rechargeTotal) {
		this.rechargeTotal = rechargeTotal;
	}

	public Double getRechargeMax() {
		return rechargeMax;
	}

	public void setRechargeMax(Double rechargeMax) {
		this.rechargeMax = rechargeMax;
	}

	public Long getWithdrawTimes() {
		return withdrawTimes;
	}

	public void setWithdrawTimes(Long withdrawTimes) {
		this.withdrawTimes = withdrawTimes;
	}

	public Double getWithdrawTotal() {
		return withdrawTotal;
	}

	public void setWithdrawTotal(Double withdrawTotal) {
		this.withdrawTotal = withdrawTotal;
	}

	public Double getOneTimeWithdrawAmountMin() {
		return oneTimeWithdrawAmountMin;
	}

	public void setOneTimeWithdrawAmountMin(Double oneTimeWithdrawAmountMin) {
		this.oneTimeWithdrawAmountMin = oneTimeWithdrawAmountMin;
	}

	public Double getOneTimeWithdrawAmountMax() {
		return oneTimeWithdrawAmountMax;
	}

	public void setOneTimeWithdrawAmountMax(Double oneTimeWithdrawAmountMax) {
		this.oneTimeWithdrawAmountMax = oneTimeWithdrawAmountMax;
	}

	public Long getDailyWithdrawTimesMax() {
		return dailyWithdrawTimesMax;
	}

	public void setDailyWithdrawTimesMax(Long dailyWithdrawTimesMax) {
		this.dailyWithdrawTimesMax = dailyWithdrawTimesMax;
	}

	public Double getDailyWithdrawAmountMax() {
		return dailyWithdrawAmountMax;
	}

	public void setDailyWithdrawAmountMax(Double dailyWithdrawAmountMax) {
		this.dailyWithdrawAmountMax = dailyWithdrawAmountMax;
	}

	public Double getOneTimeRechargeAmountMin() {
		return oneTimeRechargeAmountMin;
	}

	public void setOneTimeRechargeAmountMin(Double oneTimeRechargeAmountMin) {
		this.oneTimeRechargeAmountMin = oneTimeRechargeAmountMin;
	}

	public Double getOneTimeRechargeAmountMax() {
		return oneTimeRechargeAmountMax;
	}

	public void setOneTimeRechargeAmountMax(Double oneTimeRechargeAmountMax) {
		this.oneTimeRechargeAmountMax = oneTimeRechargeAmountMax;
	}

	public Long getDailyRechargeTimesMax() {
		return dailyRechargeTimesMax;
	}

	public void setDailyRechargeTimesMax(Long dailyRechargeTimesMax) {
		this.dailyRechargeTimesMax = dailyRechargeTimesMax;
	}

	public Double getDailyRechargeAmountMax() {
		return dailyRechargeAmountMax;
	}

	public void setDailyRechargeAmountMax(Double dailyRechargeAmountMax) {
		this.dailyRechargeAmountMax = dailyRechargeAmountMax;
	}
	
}
